﻿
@{
    TipsInfo tipsInfo = ViewBag.TipsInfo;
    Layout = "~/Areas/Member/Views/_LoginLayoutPage.cshtml";
    ViewBag.Title = "OAuth2.0登录";
}
<div class="container">
    <div class="loginBox">
        <div class="content-box">
            <div class="media logo-media"></div>
            <div class="login-sign">OAuth2.0登录</div>
            <div id="LoginBox">
 
                <div class="form-group">
                    <span id="lb_msg"></span>
                </div>

                <div class="form-group">
                    <div class="text-left">
                        <a href="@Url.ActionUrl("Index","Reg")" class="text-primary">注册会员</a> / <a href="@Url.ActionUrl("Index","Login")" class="text-primary">转到登录</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var open =@ViewBag.Open;
    var state=@tipsInfo.State;
    var msg = "@tipsInfo.Msg";
    var $lbMsg = $("#lb_msg");
    //初始化
    function Init()
    {
        if (open == 0) {
            $lbMsg.text("对不起，网站登录功能已关闭！");
        }
        else if (state == 0)
        {
            $lbMsg.text("授权失败：" + msg).addClass("text-danger");
        }
    }
    Init();
    function Login()
    {
        $lbMsg.text("授权成功！").addClass("text-success");
        var to = Request("to");
        if (to == "")
        {
            to = "@Url.ActionUrl("Index","Default")";
        }
        top.location.href = to;
    }
    if (state == 1)
    {
        Login();
    }
</script>
